package com.kingyun.gpsinspection.purificationservice.facade.service.tdm;

import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.EmployeeVo;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.RedisValue;
import com.kingyun.gpsinspection.purificationservice.facade.model.tdm.*;

import java.util.List;

/**
 * Created by liyi on 2016/12/14.
 * 分析处理任务Service
 */
public interface AnalysisProcessService {
    /**
     * 保存分析处理信息
     *
     * @param employeeVo
     * @param analysisProcess
     * @param problem
     * @return
     */
    AnalysisProcess saveAnalysisProcess(RedisValue redisValue, EmployeeVo employeeVo, AnalysisProcess analysisProcess, Problem problem, String source, String uploadFiles, String deletedFiles);

    /**
     * 根据任务流程ID分析处理信息
     * @param piid
     * @return
     * @throws Exception
     */
    AnalysisProcessVo findAnalysisProcessByPiid(String piid)throws Exception;

    /**
     * 根据分析处理ID修改上报问题信息与分析处理节点
     *
     * @param analysisProcess
     * @param problem
     * @return
     */
    int updateById(AnalysisProcess analysisProcess, Problem problem, TaskLink taskLink);

    /**
     * 处理流程信息
     * @param employeeVo
     * @param analysisProcess
     * @param disposeMeasure
     * @param taskLink  @return
     */
    int disposeTask(RedisValue redisValue, EmployeeVo employeeVo, AnalysisProcess analysisProcess, DisposeMeasure disposeMeasure, TaskLink taskLink, String uploadFiles, String deletedFiles);

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    AnalysisProcessVo queryByPrimaryKey(String id);

    /**
     * 根据问题ID查询分析处理任务
     * @param problemId
     * @return
     */
    List<AnalysisProcessVo> findVoListByProblemId(String problemId);

    /**
     * 根据当前登录人信息和分析处理的流程实例ID获得当前登录人的待办
     *
     * @param employeeVo
     * @param redisValue
     * @param flowId
     * @return
     */
    TaskLink findTaskLinkByUserInfoFlowId(EmployeeVo employeeVo, RedisValue redisValue, String flowId);

    /**
     * 判断当前登录人是否可以处理分析处理任务
     *
     * @param employeeVo
     * @param redisValue
     * @param flowId
     * @return
     */
    Boolean checkCanDispose(EmployeeVo employeeVo, RedisValue redisValue, String flowId);
}
